
#ifndef _BIT_DEFINE_H_
#define _BIT_DEFINE_H_

#include <stdint.h>

#define Bit(x)                       ((uint32_t)((uint32_t)0x01U<<(x)))
#define Bits(start, end)             ((0xFFFFFFFFUL << (start)) & (0xFFFFFFFFUL >> (31U - (uint32_t)(end)))) 
#define Bits_Get(val, start, end) (((val) & Bits((start),(end))) >> (start))
#define Bits_Test(val, start, end, tagval)	(Bits_Get(val, start, end) == (tagval))

#endif /*_BIT_DEFINE_H_*/


